#pragma once

#include "Common/MessageDispatch/MessageDispatch.h"
#include "Common/Event/Event.h"
#include "Common/EventDefine.h"
#include "Common/CharacterDefine.h"

class LogicUnionModule : public IServerMessageHandler,public  IClientMessageHandler,public IEventExecuteSink
{
public:
	bool Init();
	void UnInit();
	//////////////////////////////  IServerMessageHandler ////////////////////////////////////////////
	virtual void		onServerMessage(uint32_t actionId, RECV_PACKAGE &package);
	virtual const char* getServerHandlerDebugInfo(void){ return "LogicUnionModule::onServerMessage"; }
	////////////////////////////// IClientMessageHandler ////////////////////////////////////////////
	virtual void		onClientMessage(uint32_t actionId, RECV_PACKAGE &package, uint64_t Id = 0);
	virtual const char* getClientHandlerDebugInfo(void) { return "LogicUnionModule::onClientMessage"; };
	//////////////////////////////////////////////////////////////////////////
	virtual void		OnExecute(uint16_t nEventID, uint64_t nSrcID, uint8_t bySrcType, void *pContext, int32_t nLen);
public:
	LogicUnionModule();
	virtual ~LogicUnionModule();
private:
	void Create(CharIDType charId, RECV_PACKAGE &package);

	void CLCreate(RECV_PACKAGE &package);
	void CLCharUnionUpdate(RECV_PACKAGE &package);
	void CLUnionDismiss(RECV_PACKAGE &package);
	void CLUnionKickMem(RECV_PACKAGE &package);
	void CLUnionFetchScore(RECV_PACKAGE &package);
	void CLBindUnionHomeScene(RECV_PACKAGE &package);
	void CLUnionActivityState(RECV_PACKAGE &package);
	void CLUnionLevUpdate(RECV_PACKAGE &package);
	void CLUnionFightUp(RECV_PACKAGE &package);
	void CLUnionMakeUp(RECV_PACKAGE &package);
	void CLUnionLeaderFacade(RECV_PACKAGE &package);
	void CLUnionDungeonClose(RECV_PACKAGE &package);
};